home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
C-D
/
Capt. Midnight Code Ring.cpt
/
Capt. Midnight Code Ring
/
card_4003.txt
< prev
next >
Wrap
Text File
|
1989-02-26
|
2KB
|
102 lines
-- card: 4003 from stack: in. Midnight Code Ring
-- bmap block id: 0
-- flags: 4000
-- background id: 3304
-- name: Decoder
-- part 2 (button)
-- low flags: 00
-- high flags: 8000
-- rect: left=50 top=291 right=336 bottom=92
-- title width / last selected line: 0
-- icon id / first selected line: 9761 / 9761
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Crypt
----- HyperTalk script -----
on mouseUp
if length(field 2) > 0 then
put the ticks into start
put length(field 1) && "characters to process." into message
set cursor to 4
put "" into it
repeat with k = 1 to number of lines in field 2
put line k of field 2 into key
put length(key) into x
repeat with i = 1 to length(field 1)
put bxor((charToNum(char i of field 1) mod 128), charToNum(char (i mod x) + 1 of key)) into crypt
if crypt = 0 then put 128 into crypt
put it & numToChar(crypt) into it
end repeat
put it into field 1
put "" into it
put length(field 1) && "charcters processed with" && k && "keys in" && (the ticks - start)/60 && "seconds." into msg
end repeat
end if
beep
wait 5 seconds
hide msg
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: 8000
-- rect: left=92 top=291 right=336 bottom=134
-- title width / last selected line: 0
-- icon id / first selected line: 1004 / 1004
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Get File
----- HyperTalk script -----
on mouseUp
put fileName("TEXT") into path
if path is not empty then
put "" into field 1
put " " into it
open file path
repeat until it is empty
read from file path for 16000
put field 1 & it into field 1
end repeat
end if
close file path
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: 8000
-- rect: left=134 top=291 right=336 bottom=176
-- title width / last selected line: 0
-- icon id / first selected line: 1004 / 1004
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Save File
----- HyperTalk script -----
on mouseUp
put newFileName("Save in what file?","") into path
if path is not empty then
open file path
write field 1 to file path
end if
close file path
end mouseUp
-- part contents for background part 1
----- text -----
apple